Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added course purchases and auth system #324

Closed
wants to merge 1 commit into from

Conversation

dhruvilmehta
Copy link
Contributor

PR Fixes:

  • 1 Added user registeration system
  • 2 Purchase with Razorpay

Resolves #169

Checklist before requesting a review

  • I have performed a self-review of my code
  • [] I assure there is no similar/duplicate pull request regarding same issue
    Similar to @devsargam but added a little tweaks to DB schema and URLs for buying courses.

UI is broken for now but can be done soon once this is approved.

Approach:

DB Schema
Untitled-2024-04-02-1559

Flow of payment
Untitled-2024-04-02-1610

Note: 8 files just have formatting changes due to prettier check while committing.

@dhruvilmehta
Copy link
Contributor Author

dhruvilmehta commented Apr 3, 2024

Receipts page (users can see bought courses and receipt id:

image

Buy Courses page:

image

Course Details page (where the user can see about the course content and can see the buy button):
Razorpay pops up when clicked on Pay Now Button

image

@hkirat
Copy link
Contributor

hkirat commented Apr 12, 2024

This is great, will review later today

@hkirat hkirat self-requested a review April 12, 2024 11:26
@dhruvilmehta
Copy link
Contributor Author

Hey @hkirat , are you also interested in integrating crypto payments with coinbase commerce api? If yes, I can start working on that.

@dhruvilmehta dhruvilmehta force-pushed the authAndPayment branch 3 times, most recently from 65c1ce5 to dc6d48a Compare May 21, 2024 02:22
@dhruvilmehta
Copy link
Contributor Author

Hey @hkirat, are you still interested in this feature?

@hkirat
Copy link
Contributor

hkirat commented Jun 5, 2024

yes this is top priority for me to review
will probably do tom

@hkirat
Copy link
Contributor

hkirat commented Jun 6, 2024

So the signup logic here is useful, I'll be copying that over
The razorpay logic has some issues.
We'll be using a webhook from razorpay to tell us if a purchase is made, and when made it should populate the Purchase table - https://github.com/code100x/cms/blob/main/prisma/schema.prisma#L26

I'll be shelving the PR for now (not closing it as we may need payments in the future). But we will have to get rid of the client side call here - and replace it with a webhook from rzp - https://github.com/code100x/cms/pull/324/files#diff-68bf6bcd40c0526800dac7b625b2c2ecaee8433b54f07d37738e3155cd1fe501R55

@hkirat
Copy link
Contributor

hkirat commented Jun 6, 2024

/bounty $25 for the effort

@devsargam
Copy link
Collaborator

devsargam commented Jun 6, 2024

Hey @hkirat just in case this could be helpful
ref: #175

@dhruvilmehta dhruvilmehta force-pushed the authAndPayment branch 3 times, most recently from 7619534 to da7f50d Compare June 14, 2024 01:35
@dhruvilmehta
Copy link
Contributor Author

Hi @hkirat , I have added a webhook for razorpay. You can test this webhook on localhost with ngrok. It gives you a public url for your localhost:3000. You have to put the public url on razorpay and receive events for payments.captured event.

@siinghd
Copy link
Collaborator

siinghd commented Jun 19, 2024

@dhruvilmehta will be testing it ASAP

@dhruvilmehta
Copy link
Contributor Author

Hi @siinghd , are you testing it? If everything seems fine, we can merge it before Web3 cohort launch. Just the UI part would be remaining that can be done ASAP.

@devsargam devsargam closed this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add purchases, payment information
4 participants